This invention relates to the field of computer systems. More particularly, a method and apparatus are provided for avoiding contention when accessing memory during concurrent packet enqueue and dequeue operations.
A data center, a computing cluster, or other collection of computing assets often must interface with multiple networks or other communication links, and distribute communication traffic among different computing devices. For example, a data center may include an InfiniBand network fabric and one or more host computer systems. The InfiniBand systems may exchange communication traffic with other (e.g., remote) systems via a non-InfiniBand network or communication link (e.g., the Internet).
In this data center, a computing device may be assigned to handle the transfer of communications (e.g., packets) between the InfiniBand environment and the other (e.g., Internet Protocol or IP) environment. The computing device may be configured to receive inbound traffic and store it for forwarding to a host.
The process of storing a communication for forwarding is often termed enqueuing, while the process of removing and forwarding the communication is termed dequeuing. Collisions occur when the enqueue process needs to access an area of memory that the dequeue process also needs to access. Illustratively, this may occur if a packet being enqueued belongs to the same communication connection that the dequeue process needs to work with. For example, the dequeue process may visit each queue pair in turn (e.g., via round robin scheduling) to try and dequeue communications, and the target communication connection of the enqueue process may match the target communication connection of the dequeue process.
In such situations—when the same area of a shared memory needs to be accessed by different processes—an arbiter is traditionally employed to arbitrate access. However, use of an arbiter delays communication processing, especially if every access to the memory must be arbitrated. In addition, the memory may be able to support simultaneous access as long as the same area or address is not being targeted.
Therefore, there is a need for a method and apparatus for supporting concurrent access to shared memory while avoiding the cost involved in using an arbiter.